<%@ page import="Dao.booksDAO" %>
<%@ page import="JavaBean.Book" %>
<%@ page import="JavaBean.users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page isELIgnored="false"%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书详情页</title>
    <link rel="stylesheet" href="./css/main.css">
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
</head>
<body>
<%
    //接收到index2用户成功登录页面发来的userID
//    String userID = (String) request.getAttribute("userID");
//    System.out.println("good.jsp userID = " + userID);
//
//    Object userID1 = session.getAttribute("userID");
//    HttpSession session1 = request.getSession();
//    System.out.println("session1 = " + session1);

    //
    //再把这个userID转发到doEditUserBooksIN.jsp页面
//    request.setAttribute("userID",userID);

    //
    String ID = request.getParameter("id");
    request.setAttribute("bookID",ID);
    booksDAO dao= new booksDAO();
    Book books = dao.getAllBooksByID(ID);
    pageContext.setAttribute("ID",ID);
    pageContext.setAttribute("books",books);
%>
<div class="header_con">
    <div class="header">
        <div class="welcome">欢迎来到无忧图书馆!</div>
        <div class="user_login">
            <a href="loginRegister.jsp">登录</a>
            <span>|</span>
            <a href="loginRegister.jsp">注册</a>
            <span>|</span>
            <a href="loginRegister.jsp">我的书架</a>
        </div>
    </div>
</div>
<div class="search_bar clearfix">
    <a href="index.jsp" class="logo fl"><img src="./imgs/logo.png" style="background-color: rgb(47,54,95);width: 100px;height: 55px;"></a>
    <div class="search_con fl">
        <input type="text" class="input_text fl" placeholder="搜索书籍">
        <input type="button" class="input_btn fr" value="搜索">
    </div>
    <div class="guest_card fr">
        <a href="loginRegister.jsp" class="card_name fl">我的收藏</a>
        <div class="goods_count fl">1</div>
    </div>
</div>
<!-- 商品信息栏 -->
<div class="navbar_con">
    <div class="navbar clearfix">
        <div class="subnav_con fl">
            <h1>全部书籍分类 <i></i></h1>
        </div>
        <ul class="navlist fl">
            <li><a href="index.jsp">首页</a></li>
            <li><a href="future.jsp">关注</a></li>
            <li><a href="future.jsp">抽奖</a></li>
        </ul>
    </div>
</div>
<div class="submena clearfix">
    <a href=" ">全部分类</a>
    <span>></span>
    <a href=" ">火热书籍</a>
    <span>></span>
    <a href=" ">书籍详情</a>
</div>
<div class="center_con clearfix">
    <div class="main_menu fl"><img src="./imgs/book-03.jpg" ></div>
    <div class="goods_detail_list fr" >
        <span style="font-size: 30px;padding-right: 10px;">${books.getName()}</span>
        <span style="padding-right:15px;">作者：<a href="#">${books.getAuthor()}</a></span>
        <span style="padding-right:15px;">出版社：<a href="#">${books.getPublish()}</a></span>
        <span style="padding-right:15px;">出版日期：<a href="#">${books.getPublishdate()}</a></span>

        <p>
            ${books.getBookresume()}
        </p>

        <div class="prize_bar">
            <div class="show_prize fl">￥<em>${books.getPrice()}</em></div>
            <div class="show_unit fl">单位：本</div>
            <div class="show_unit fl">ISBN：<em>${books.getIsbn()}</em></div>
        </div>
        <div class="goods_num clearfix">
            <div class="num_name fl">数量：</div>
            <div class="num_add fl">
                <input type="text" class="num_show fl" value="1">
                <a href="javascript:;" class="add fr">+</a>
                <a href="javascript:;" class="minus fr">-</a>
            </div>
        </div>
        <div class="total">总价：<em>${books.getPrice()}元</em></div>
        <div class="operate_btn">
            <a href="/adminstrator/booksManager/readBook.jsp?id=${books.id}" class="buy_btn">立即阅读</a>
        </div>
    </div>
</div>

</body>
</html>
